<template>
  <div>
    <a-date-picker @change="getDate" />
    <div class="box"><a-time-picker @change="getTime" /></div>
  </div>
</template>
<script setup>
import moment from 'moment'
import { ref, watch, reactive, toRefs, onMounted } from 'vue'
const curdate = ref('')
const curtime = ref('')
const getDate = (date, dateString) => {
  curdate.value = dateString
  console.log(curdate.value)
  let param = {
    curdate: curdate.value,
  }
  emits('getDate', param)
}
const getTime = (date, dateString) => {
  curtime.value = dateString
  console.log(curtime.value)
  let param = {
    curtime: curtime.value,
  }
  emits('getTime', param)
}
//子组件传值
const emits = defineEmits(['getDate', 'getTime'])
</script>
<style scoped>
.ant-picker {
  width: 110px;
}
.box {
  float: right;
}
</style>
